   1 .   
  10 F=rnd (3);G=F;I=rnd (3);J=rnd (3);K=1;M=rnd (16)+16;&(23)=255
  20 FC=7;BC=8;P=0;C=1200;D=8;E=0;O=0;clear 
  25 V=rnd (3);W=rnd (3);Q=rnd (4);if M<3W=M
  30 gosub 860;gosub 880;CY=40;print " 1 2 3 4 5 6 7";for H=1to 7;print #1,H;next H
  40 CY=24;CX=10;print "QDRNT ",#1,F,"-",G
  50 CX=10;print "ENRGY ",#1,C;CX=10;print "TORPS ",#1,D;CX=10;print "SHLDS ",#1,E;CX=10;print "KLGOS ",#1,M,"-",W
  53 if O if Kgosub 880;CY=8;CX=-65;print "DEATH STAR";goto 140
  56 if E<0print "ENTERPRISE DESTROYED!";goto 1200
  60 if Q=0goto 75
  70 for H=1to Q;gosub 120;print "*",;next H
  75 if W=0goto 90
  80 for H=1to W;gosub 120;print "K",;next H
  90 if V=3gosub 120;print "$",
  95 if P goto 110
 100 if W=1gosub 120;print "S",
 110 goto 140
 120 R=rnd (7)mul 12-83;X=rnd (7)mul 8-24;CX=R;CY=X;return 
 140 N=-36;T=8;gosub 890
 150 CX=-77;CY=-24;input "COMMAND:"T;if (T<1)+(T>5)goto 150
 153 if (T=1)+(T=5)goto 160
 156 if C<1goto 150
 160 goto Tmul 200
 200 input "UNITS TO SHIELDS"H
 210 if (H<0)+(C+E-H<0)goto 30
 220 C=C+E-H;E=H;goto 30
 400 if W#0goto 410
 405 print "WEAPON:NEGATIVE";goto 30
 410 input "UNITS TO FIRE"U
 420 if (U<1)+(C-U<0)goto 30
 430 C=C-U;T=W;for H=1to W;gosub 860;if Udiv W-Qmul rnd (5)>100goto 450
 440 print "NOT ENOUGH FIRE-POWER";next H;goto 460
 450 print "KLINGON DESTROYED";M=M-1;W=W-1;next H
 460 E=E-Udiv T-Qmul rnd (5)mul T
 470 gosub 850;goto 30
 600 if (W=0)+(D=0)goto 405
 610 input "TRAJ. X"R;CY=-32;input "TRAJ. Y"X;if (R<1)+(R>8)+(X<1)+(X>8)goto 30
 620 N=-30;T=8;gosub 890;N=Rmul 12-84;T=(8-X)mul 8-24;gosub 890;CY=-32;print "TYPE 1 TO FIRE
 640 if KP&(21)=255;gosub 860;if O if K print "DEATH STAR HIT!";C=-1;K=0;goto 690
 650 if PX(N-2,T-3)=1M=M-1;W=W-1;gosub 870
 660 if PX(N-1,T-3)=1P=1;M=M-1;gosub 870
 670 if PX(N-1,T-2)=1V=2;print "WHO'S SIDE ARE YOU ON?"
 680 if PX(N-1,T-1)=1 Q=Q-1;gosub 870
 690 D=D-1;for H=1to 100;box N,T,5,7,3;next H;&(21)=0
 700 E=E-(100mul W+rnd (50))div 2
 710 if C=-1goto 20
 720 gosub 850;goto 30
 800 input "QUADRANT X"Y
 810 gosub 860;input "QUADRANT Y"U;gosub 860
 820 if (Y<1)+(Y>3)+(U<1)+(U>3) goto 30
 825 if F=Y if G=U print "ILLEGAL MOVE";goto 30
 830 O=0;if K if Y=I if U=J for H=1to 10;gosub 860;print "T000000000M";next H;O=1
 840 C=C-ABS(F-Y)mul 10-ABS(G-U)mul 10;F=Y;G=U;goto 25
 850 if M=0print "WELL DONE,ALL KLINGONS    DESTROYED!";goto 1200
 855 return 
 860 CY=-32;box 0,-32,160,24,2;return 
 870 print "DIRECT HIT!";return 
 880 box -35,8,78,56,2;return 
 890 box N,T,5,1,2;box N,T,1,5,2;return 
1000 clear ;print "YOU HAVE INSTRUCTED THE   ON-BOARD COMPUTER TO SELF DESTRUCT!
1200 print "GAME OVER"
:return ;run 
